<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <meta name="copyright" content=
    "Copyright (c) Red Hat Incorporated 2006, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <title>
      Generating a Config File for the Formatter Application
    </title>
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type=
    "text/css" />
  </head>

  <body>
    <h1>
      Generating a Config File for the Formatter Application
    </h1>
    <p>
      Generating a config file for the formatter application involves modifying
      the code formatter settings for a Java project and copying
      org.eclipse.jdt.core.prefs out of the .settings directory for that
      project.
    </p>
    <ol>
      <li>Select a Java project, open the pop-up menu and choose
      <strong>Properties</strong>.
      </li>

      <li>Select the <strong>Java Code Style &gt; Formatter</strong> page and
      check <strong>Enable project specific settings</strong>.
      </li>
      <li>Select or edit a profile as explained above.
      </li>
      <li>Click <strong>OK</strong> when you are done.
      </li>

      <li>Use either a file manager or the command line to copy
      <b><code>workspace/YourJavaProject/.settings/org.eclipse.jdt.core.prefs</code></b>
      to a new location.
      </li>
      <li>If the files you want to format are using 1.5 constructs, you must
      add the following lines inside the preference file you just created:
        <blockquote>
          <code>org.eclipse.jdt.core.compiler.compliance=1.5<br />
          org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5<br />
          org.eclipse.jdt.core.compiler.source=1.5<br /></code>

        </blockquote>
      </li>
    </ol>

    <h3 class="related">Related References</h3>
      <a href=
      "../reference/preferences/java/codestyle/ref-preferences-formatter.htm">Code
      formatter</a>
  </body>
</html>
